/**
 * 
 */
package com.elite.groovy.callback

import groovy.json.* //导入grooby的json解析api包
import java.util.Map;
import com.elite.groovy.util.EliteBean
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.wisdge.utils.RandomUtils;
import com.elite.groovy.util.Util;
import net.sf.json.JSONObject;
import net.sf.json.JSONArray;
import cn.com.elite.PropertiesUtil;
/**
 * @author luper
 *
 */
public class OtherHFCreate1 implements ServiceBackInvoke{
	private static final Log log=LogFactory.getLog(OtherHFCreate1.class);
	private String charset = "utf-8"; //设置字符集
	private int timeout = 100000; //设置请求超时时间
	private int enableSSLflag = 0;	
	public String doCallBack(EliteBean eliteBean, HttpServletRequest request, HttpServletResponse response){
			
		log.debug("承保新单回访数据开始生成！");
		log.debug("承保新单未回访数据提前打标");
        def updatesql5="update dh_POLICY set TASKSTATUS=3 where TASKSTATUS=0 and payreftime<trunc(sysdate-2)";
		def updatesqlresult5=eliteBean.update(updatesql5,"dataSource");
		log.debug("updatesqlresult5:"+updatesqlresult5);
		def updatesqlresult2,isvip;
		//TASKSTATUS=0 待发送，TASKSTATUS=3 直接生成回访
		def relist=eliteBean.chaxun_sql("select sysguid as oguid,sysguid as vguid, PolicyNo as str_M,0 as ,'POLICY' as obtype,to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') as curdate,'','NJG6SF' as mapid,'xd' as btype,INSUREDNAME,INSUREDMOBILE,identifynumber,policyno from dh_POLICY where  TASKSTATUS=3","dataSource");
		if(relist.size()>0){
			for(def i=0;i<relist.size();i++){
				isvip=doselete(relist[i].get("policyno"),relist[i].get("INSUREDMOBILE"),eliteBean,relist[i].get("INSUREDNAME"),charset,timeout,enableSSLflag);

				if(isvip=="2"){
					//插入待回访数据
					updatesqlresult2=eliteBean.update("insert into Ob_visitTask(VISITTASK_GUID,OBJECTIVE_GUID,BUSINESSNO,TASKSTATUS,BUSTYPE, CREATEDDATE, CREATEDBY,MAP_ID,BUSTYPE_REPORT)values('"+relist[i].get("vguid")+"','"+relist[i].get("oguid")+"','"+relist[i].get("str_M")+"',0,'"+relist[i].get("obtype")+"',to_date('"+relist[i].get("curdate")+"','yyyy-mm-dd hh24:mi:ss'),'','"+relist[i].get("mapid")+"','"+relist[i].get("btype")+"')","dataSource");				
				}else{
					//插入直接生成回访数据
					updatesqlresult2=eliteBean.update("insert into Ob_visitTask(VISITTASK_GUID,OBJECTIVE_GUID,BUSINESSNO,TASKSTATUS,BUSTYPE, CREATEDDATE, CREATEDBY,MAP_ID,BUSTYPE_REPORT)values('"+relist[i].get("vguid")+"','"+relist[i].get("oguid")+"','"+relist[i].get("str_M")+"',3,'"+relist[i].get("obtype")+"',to_date('"+relist[i].get("curdate")+"','yyyy-mm-dd hh24:mi:ss'),'','"+relist[i].get("mapid")+"','"+relist[i].get("btype")+"')","dataSource");				

					 //生成 objective
                  def updatesql45="insert into objective (OBJECTIVE_GUID, OBJECTIVETYPE_ID, HANDLEGROUP_ID,PRIORITY_ID,EXPIREDDATE,CUSTOMER_GUID,OBJECTIVESTATUS,CREATEDDATE,CREATEDBY,WORKORDERFRAME_ID,OBJECTIVESUBSTATUS,MAP_ID,CURSTEP_ID_MAP)select objective_guid,'USZP59','ORG016','NORMAL',sysdate,'"+isvip+"','OPEN',CREATEDDATE,CREATEDBY,map_id,'OPEN',map_id,'5JT51D' from Ob_visitTask where visittask_guid='"+relist[i].get("vguid")+"'";
				  
                  def updatesqlresult45=eliteBean.update(updatesql45,"dataSource");
                  log.debug("updatesqlresult45:"+updatesqlresult45);
                    //生成 elitetask 
                  def updatesql46="insert into elitetask (ELITETASK_GUID, OBJECTIVE_GUID, OBJECTIVETYPE_ID, EXPECTSTARTTIME,OBSTATUS,PRIORITY, HANDLEGROUP_ID, CREATEDBY, CREATEDDATE,CUSTOMER_GUID,CURSTEPSTATUS,CURSTEP_ID_MAP,MAP_ID,OBJECTIVESUBSTATUS,ELITETASKSTATUS, OBFLAG) select sysguid,objective_guid,'USZP59',sysdate,'OPEN','NORMAL','ORG016',CREATEDBY,CREATEDDATE,'"+isvip+"','OPEN','5JT51D',MAP_ID,'OPEN','OPEN','1' FROM Ob_visitTask where visittask_guid='"+relist[i].get("vguid")+"'";
                  def updatesqlresult46=eliteBean.update(updatesql46,"dataSource");
                  log.debug("updatesqlresult46:"+updatesqlresult46);		
					
				}
				authenticSelect(relist[i].get("INSUREDNAME"),relist[i].get("INSUREDMOBILE"),relist[i].get("identifynumber"),relist[i].get("vguid"),eliteBean,charset,timeout,enableSSLflag);
			}
		
		}
				
		
		log.debug("承保新单已写入待回访中间表更新状态");
        def updatesql7="update dh_POLICY set TASKSTATUS=2 where TASKSTATUS=3";
		def updatesqlresult7=eliteBean.update(updatesql7,"dataSource");
		log.debug("updatesqlresult7:"+updatesqlresult7);		
		
		log.debug("结案回访数据开始生成！");
		log.debug("结案未回访数据提前打标");
        def updatesql8="update COREUSER.CC_CORE_CASE_CLOSED set TASKSTATUS=3 where REGISTNO IN(select REGISTNO  from ( SELECT ROW_NUMBER() OVER(PARTITION BY p.registno order by p.enddate) prn,p.* from coreuser.cc_core_case_closed p where p.prplcompensatesumdutypaid > 0 and p.enddate < sysdate - 4 and p.status is null and p.prplregistreportorphonenumber is not null ) q where q.prn = 1 and q.TASKSTATUS=0)";
		def updatesqlresult8=eliteBean.update(updatesql8,"dataSource");
		log.debug("updatesqlresult8:"+updatesqlresult8);
		
		
		
		//TASKSTATUS=0 待发送，TASKSTATUS=3 直接生成回访
		def relist2=eliteBean.chaxun_sql("select sysguid as oguid,sysguid as vguid, REGISTNO as str_M,0,'JA' as obtype,to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') as curdate,'','D6RG1E' as mapid ,'' as btype,case when  q.PayeeName=q.INSUREDNAME then q.PayeeName else r.LINKER_NAME end as LINKER_NAME,case when  q.PayeeName=q.INSUREDNAME then q.Payeemobile else r.Linker_Phone end as Linker_Phone,q.ISINTERNET as ISINTERNET ,r.happened_time as happened_time,r.Examine_Address as Examine_Address ,r.policy_no policy_no from ( SELECT ROW_NUMBER() OVER(PARTITION BY p.registno order by p.enddate) prn,p.* from coreuser.cc_core_case_closed p where p.prplcompensatesumdutypaid > 0 and p.enddate < sysdate - 4 and p.status is null and p.prplregistreportorphonenumber is not null ) q  left join DH_REPORT r on r.clm_no=q.registno where q.prn = 1 and q.TASKSTATUS=3","dataSource");
		if(relist2.size()>0){
			for(def j=0;j<relist2.size();j++){
				isvip=doselete(relist2[j].get("policy_no"),relist2[j].get("Linker_Phone"),eliteBean,relist2[j].get("LINKER_NAME"),charset,timeout,enableSSLflag);
				def happened_time=relist2[j].get("happened_time");
				def Examine_Address=relist2[j].get("Examine_Address");
				//B开头平安保单直接人工回访
				def policy_no = relist2[j].get("policy_no");


				if(isvip=="2"&&happened_time!=''&&Examine_Address!=''&&happened_time!=null&&Examine_Address!=null&&policy_no.substring(0,1)!="B"){
					//20230323  结案全部转机器人
					//插入待发送回访数据
					updatesqlresult2=eliteBean.update("insert into Ob_visitTask(VISITTASK_GUID,OBJECTIVE_GUID,BUSINESSNO,TASKSTATUS,BUSTYPE, CREATEDDATE, CREATEDBY,MAP_ID,BUSTYPE_REPORT,ISINTERNET)values('"+relist2[j].get("vguid")+"','"+relist2[j].get("oguid")+"','"+relist2[j].get("str_M")+"',0,'"+relist2[j].get("obtype")+"',to_date('"+relist2[j].get("curdate")+"','yyyy-mm-dd hh24:mi:ss'),'','"+relist2[j].get("mapid")+"','"+relist2[j].get("btype")+"','"+relist2[j].get("ISINTERNET")+"')","dataSource");

					//20220601  胡啟滨提出结案全改人工回访
					/*updatesqlresult2=eliteBean.update("insert into Ob_visitTask(VISITTASK_GUID,OBJECTIVE_GUID,BUSINESSNO,TASKSTATUS,BUSTYPE, CREATEDDATE, CREATEDBY,MAP_ID,BUSTYPE_REPORT,ISINTERNET,CALLLOSE)values('"+relist2[j].get("vguid")+"','"+relist2[j].get("oguid")+"','"+relist2[j].get("str_M")+"',1,'"+relist2[j].get("obtype")+"',to_date('"+relist2[j].get("curdate")+"','yyyy-mm-dd hh24:mi:ss'),'','"+relist2[j].get("mapid")+"','"+relist2[j].get("btype")+"','"+relist2[j].get("ISINTERNET")+"',1)","dataSource")
					def custid=eliteBean.chaxun_sql("select customer_guid from(select customer_guid from CUSTOMER c  where mobile= '"+relist2[j].get("Linker_Phone")+"' and stringfield18 = '"+relist2[j].get("policy_no")+"' order by MODIFIEDDATE desc) where rownum=1","dataSource")
					if(custid.size()>0){
						def listtemp=custid[0]
						isvip = listtemp.get("customer_guid")
					}else{
						def cguid=Util.getGuid()
						eliteBean.update("insert into customer(CUSTOMER_GUID,customertype_id,CUSTOMERNAME,MOBILE,stringfield18,createddate,createdby,MODIFIEDDATE,MODIFIEDBY)values('"+cguid+"','KFjoin','"+relist2[j].get("LINKER_NAME")+"','"+relist2[j].get("Linker_Phone")+"','"+relist2[j].get("policy_no")+"',sysdate,'SELITE',sysdate,'SELITE')","dataSource")
						isvip = cguid
					}
					//生成 objective
					def updatesql451="insert into objective (OBJECTIVE_GUID, OBJECTIVETYPE_ID, HANDLEGROUP_ID,PRIORITY_ID,EXPIREDDATE,CUSTOMER_GUID,OBJECTIVESTATUS,CREATEDDATE,CREATEDBY,WORKORDERFRAME_ID,OBJECTIVESUBSTATUS,MAP_ID,CURSTEP_ID_MAP)select objective_guid,'USZP59','ORG016','NORMAL',sysdate,'"+isvip+"','OPEN',CREATEDDATE,CREATEDBY,map_id,'OPEN',map_id,'PKWJHN' from Ob_visitTask where visittask_guid='"+relist2[j].get("vguid")+"'"
					def updatesqlresult45=eliteBean.update(updatesql451,"dataSource")
					//生成 elitetask 
					def updatesql461="insert into elitetask (ELITETASK_GUID, OBJECTIVE_GUID, OBJECTIVETYPE_ID, EXPECTSTARTTIME,OBSTATUS,PRIORITY, HANDLEGROUP_ID, CREATEDBY, CREATEDDATE,CUSTOMER_GUID,CURSTEPSTATUS,CURSTEP_ID_MAP,MAP_ID,OBJECTIVESUBSTATUS,ELITETASKSTATUS, OBFLAG) select sysguid,objective_guid,'USZP59',sysdate,'OPEN','NORMAL','ORG016',CREATEDBY,CREATEDDATE,'"+isvip+"','OPEN','PKWJHN',MAP_ID,'OPEN','OPEN','1' FROM Ob_visitTask where visittask_guid='"+relist2[j].get("vguid")+"'"
					def updatesqlresult46=eliteBean.update(updatesql461,"dataSource")*/

				}else{
					//插入直接生成回访数据
					updatesqlresult2=eliteBean.update("insert into Ob_visitTask(VISITTASK_GUID,OBJECTIVE_GUID,BUSINESSNO,TASKSTATUS,BUSTYPE, CREATEDDATE, CREATEDBY,MAP_ID,BUSTYPE_REPORT,ISINTERNET)values('"+relist2[j].get("vguid")+"','"+relist2[j].get("oguid")+"','"+relist2[j].get("str_M")+"',3,'"+relist2[j].get("obtype")+"',to_date('"+relist2[j].get("curdate")+"','yyyy-mm-dd hh24:mi:ss'),'','"+relist2[j].get("mapid")+"','"+relist2[j].get("btype")+"','"+relist2[j].get("ISINTERNET")+"')","dataSource");				

					 //生成 objective
					def updatesql451="insert into objective (OBJECTIVE_GUID, OBJECTIVETYPE_ID, HANDLEGROUP_ID,PRIORITY_ID,EXPIREDDATE,CUSTOMER_GUID,OBJECTIVESTATUS,CREATEDDATE,CREATEDBY,WORKORDERFRAME_ID,OBJECTIVESUBSTATUS,MAP_ID,CURSTEP_ID_MAP)select objective_guid,'USZP59','ORG016','NORMAL',sysdate,'"+isvip+"','OPEN',CREATEDDATE,CREATEDBY,map_id,'OPEN',map_id,'PKWJHN' from Ob_visitTask where visittask_guid='"+relist2[j].get("vguid")+"'";

					def updatesqlresult45=eliteBean.update(updatesql451,"dataSource");
					log.debug("updatesqlresult45:"+updatesqlresult45);
					//生成 elitetask 
					def updatesql461="insert into elitetask (ELITETASK_GUID, OBJECTIVE_GUID, OBJECTIVETYPE_ID, EXPECTSTARTTIME,OBSTATUS,PRIORITY, HANDLEGROUP_ID, CREATEDBY, CREATEDDATE,CUSTOMER_GUID,CURSTEPSTATUS,CURSTEP_ID_MAP,MAP_ID,OBJECTIVESUBSTATUS,ELITETASKSTATUS, OBFLAG) select sysguid,objective_guid,'USZP59',sysdate,'OPEN','NORMAL','ORG016',CREATEDBY,CREATEDDATE,'"+isvip+"','OPEN','PKWJHN',MAP_ID,'OPEN','OPEN','1' FROM Ob_visitTask where visittask_guid='"+relist2[j].get("vguid")+"'";
					def updatesqlresult46=eliteBean.update(updatesql461,"dataSource");
					log.debug("updatesqlresult46:"+updatesqlresult46);		
					
				}
			}
		
		}
	
		log.debug("结案已写入待回访中间表更新原客服系统已取数数标记");
        def updatesql10="update COREUSER.CC_CORE_CASE_CLOSED set status=1 where TASKSTATUS=3";
		def updatesqlresult10=eliteBean.update(updatesql10,"dataSource");
		log.debug("updatesqlresult10:"+updatesqlresult10);			
		
		log.debug("结案已写入待回访中间表更新状态");
        def updatesql11="update COREUSER.CC_CORE_CASE_CLOSED set TASKSTATUS=2 where TASKSTATUS=3";
		def updatesqlresult11=eliteBean.update(updatesql11,"dataSource");
		log.debug("updatesqlresult11:"+updatesqlresult11);		
		
		
		log.debug("个人健康险回访数据开始生成！");
		log.debug("个人健康险未回访数据提前打标");
        def updatesql9="update coreuser.nccustomervisitdata c1 set c1.TASKSTATUS=3 where exists (select 1 from coreuser.nccustomervisitdata c2 where c1.policyno = c2.policyno and c2.relationship = '配偶父母' and c1.relationship ='配偶' and c1.TASKSTATUS=0  and c1.deal_date>=trunc(sysdate-1) and c1.deal_date<trunc(sysdate) and c1.visittype = 1)";
		def updatesqlresult9=eliteBean.update(updatesql9,"dataSource");
		log.debug("updatesqlresult9:"+updatesqlresult9);
		
		//TASKSTATUS=0 待发送，TASKSTATUS=3 直接生成回访
		def relist3=eliteBean.chaxun_sql("select sysguid as vguid,sysguid as oguid,c1.policyno as str_M,0,'HEALTH' as obtype,to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') as curdate,'','6J0EZR' as mapid,'' as btype,c1.insuredmobile,c1.INSUREDNAME from coreuser.nccustomervisitdata c1  where c1.TASKSTATUS=3 and c1.deal_date>=trunc(sysdate-1) and c1.deal_date<trunc(sysdate) and c1.relationship ='配偶' and c1.visittype = 1","dataSource");
		
		if(relist3.size()>0){
			for(def j=0;j<relist3.size();j++){//个人健康回访险直接生成回访数据，不用推送给智能外呼
			
				isvip=doselete2(relist3[j].get("insuredmobile"),relist3[j].get("INSUREDNAME"),eliteBean);
				//插入直接生成回访数据
				updatesqlresult2=eliteBean.update("insert into Ob_visitTask(VISITTASK_GUID,OBJECTIVE_GUID,BUSINESSNO,TASKSTATUS,BUSTYPE, CREATEDDATE, CREATEDBY,MAP_ID,BUSTYPE_REPORT)values('"+relist3[j].get("vguid")+"','"+relist3[j].get("oguid")+"','"+relist3[j].get("str_M")+"',3,'"+relist3[j].get("obtype")+"',to_date('"+relist3[j].get("curdate")+"','yyyy-mm-dd hh24:mi:ss'),'','"+relist3[j].get("mapid")+"','"+relist3[j].get("btype")+"')","dataSource");				

				 //生成 objective
                def updatesql471="insert into objective (OBJECTIVE_GUID, OBJECTIVETYPE_ID, HANDLEGROUP_ID,PRIORITY_ID,EXPIREDDATE,CUSTOMER_GUID,OBJECTIVESTATUS,CREATEDDATE,CREATEDBY,WORKORDERFRAME_ID,OBJECTIVESUBSTATUS,MAP_ID,CURSTEP_ID_MAP)select objective_guid,'USZP59','ORG016','NORMAL',sysdate,'"+isvip+"','OPEN',CREATEDDATE,CREATEDBY,map_id,'OPEN',map_id,'1V5PBD' from Ob_visitTask where visittask_guid='"+relist3[j].get("vguid")+"'";
				  
                def updatesqlresult47=eliteBean.update(updatesql471,"dataSource");
                log.debug("updatesqlresult47:"+updatesqlresult47);
                //生成 elitetask 
                def updatesql481="insert into elitetask (ELITETASK_GUID, OBJECTIVE_GUID, OBJECTIVETYPE_ID, EXPECTSTARTTIME,OBSTATUS,PRIORITY, HANDLEGROUP_ID, CREATEDBY, CREATEDDATE,CUSTOMER_GUID,CURSTEPSTATUS,CURSTEP_ID_MAP,MAP_ID,OBJECTIVESUBSTATUS,ELITETASKSTATUS, OBFLAG) select sysguid,objective_guid,'USZP59',sysdate,'OPEN','NORMAL','ORG016',CREATEDBY,CREATEDDATE,'"+isvip+"','OPEN','1V5PBD',MAP_ID,'OPEN','OPEN','1' FROM Ob_visitTask where visittask_guid='"+relist3[j].get("vguid")+"'";
                def updatesqlresult48=eliteBean.update(updatesql481,"dataSource");
                log.debug("updatesqlresult48:"+updatesqlresult48);		
					
			}
		}
		log.debug("个人健康险回访已写入待回访中间表更新状态");
        def updatesql21="update coreuser.nccustomervisitdata set TASKSTATUS=2 where TASKSTATUS=3";
		def updatesqlresult12=eliteBean.update(updatesql21,"dataSource");
		log.debug("updatesqlresult12:"+updatesqlresult12);	
	}
		
	
	
	
	
	
	
	public static String doselete(String policyno,String phone,EliteBean eliteBean,String cname,String charset,int timeout,int enableSSLflag){	
		JSONObject josnbody = new JSONObject();
		josnbody.put("username","LDTP");
		josnbody.put("password","a1e9173fc8090a220c27a33b951f8f7c");
		josnbody.put("policyno",policyno);
		josnbody.put("clientname","");
		josnbody.put("mobile","");
		Map headMap=new HashMap(); //设置头文件
		headMap.put("Content-Type","application/json");
		def url="http://ecif.edhic.com/ecif/clientQueryAnswered/clientFlagToNgs";
		try{
			def msgjson = Util.doHttpPostUseHead(url,JSONObject.fromObject(josnbody).toString(),charset,timeout,enableSSLflag,headMap);
			log.debug("----客户等级查询数据--------"+phone);
			log.debug("----msgjson--------"+msgjson);
			JSONObject obj = JSONObject.fromObject(msgjson);
			def code=obj.get("code");
			def resulterror;
			if(code!= 1000){
				resulterror="2"
				return  resulterror;
			}else{
				def custClass = obj.get("data").get("custClass");
				def clientType = obj.get("data").get("clientType");
				if("VIP五星客户".equals(custClass)||"VIP五星客户-优质".equals(custClass)||"VIP五星客户-关键".equals(custClass)){
					resulterror=eliteBean.chaxun_sql("select customer_guid from(select customer_guid from CUSTOMER c  where mobile= '"+phone+"' and stringfield18 ='"+policyno+"' order by MODIFIEDDATE desc) where rownum=1","dataSource");
					if(resulterror.size()>0){
						def listtemp=resulterror[0];
						def guid = listtemp.get("customer_guid");
						eliteBean.update("update customer set fax = '"+custClass+"', homepage ='"+clientType+"' where customer_guid = '"+guid+"'","dataSource");
						return  guid;
					}else{
						def cguid=Util.getGuid();
						eliteBean.update("insert into customer(CUSTOMER_GUID,customertype_id,CUSTOMERNAME,MOBILE,createddate,createdby,MODIFIEDDATE,MODIFIEDBY,fax,homepage,stringfield18)values('"+cguid+"','KFjoin','"+cname+"','"+phone+"',sysdate,'SELITE',sysdate,'SELITE','"+custClass+"','"+clientType+"','"+policyno+"')","dataSource");
						return  cguid;
					}
				}else{
					resulterror="2"
					return  resulterror;
				}
			}
		}catch(Exception e){
			log.debug(e);
		}
	}
	
	public static String doselete2(String phone,String cname,EliteBean eliteBean){//不调用接口直接查询客户
			try{
				log.debug("----职位查询数据--------"+phone);
				def resulterror;
				
				resulterror=eliteBean.chaxun_sql("select customer_guid from(select customer_guid from CUSTOMER c  where mobile= '"+phone+"' order by MODIFIEDDATE desc) where rownum=1","dataSource");
				log.debug("resulterror:"+resulterror);
				if(resulterror.size()>0){
					def listtemp=resulterror[0]
					return  listtemp.get("customer_guid");					
				}else{
					def cguid=Util.getGuid();
					eliteBean.update("insert into customer(CUSTOMER_GUID,customertype_id,CUSTOMERNAME,MOBILE,createddate,createdby,MODIFIEDDATE,MODIFIEDBY)values('"+cguid+"','KFjoin','"+cname+"','"+phone+"',sysdate,'SELITE',sysdate,'SELITE')","dataSource");
					log.debug("cguid:"+cguid);
					return  cguid;
				}
			}catch(Exception e){
				log.debug(e);
			}	
	}


	public static String authenticSelect(String name,String phone,String customerid,String customer_guid,EliteBean eliteBean,String charset,int timeout,int enableSSLflag){
		def urllist=eliteBean.chaxun_sql("select url,th_code,dd_key from sysc_interface where urltype='ecifreal'","dataSource");

		JSONObject josnbody = new JSONObject();
		josnbody.put("userName",urllist[0].get("th_code"));
		josnbody.put("password",urllist[0].get("dd_key"));
		josnbody.put("clientName",name);
		josnbody.put("mobile",phone);
		josnbody.put("identifyNumber",customerid);
		Map headMap=new HashMap(); //设置头文件
		headMap.put("Content-Type","application/json");
		def url=urllist[0].get("url");
		try{
			def msgjson = Util.doHttpPostUseHead(url,JSONObject.fromObject(josnbody).toString(),charset,timeout,enableSSLflag,headMap);
			log.debug("----客户真实性查询--------"+phone);
			log.debug(msgjson);
			JSONObject obj = JSONObject.fromObject(msgjson);
			def code=obj.get("code");
			def resulterror;
			if(code!= 1000){
				resulterror="2"
				return  resulterror;
			}else{
				eliteBean.update("update Ob_visitTask set authResult='"+obj.getString("authResult")+"',checkResult='"+obj.getString("checkResult")+"' where VISITTASK_GUID='"+customer_guid+"'","dataSource");
				return customer_guid;
			}
		}catch(Exception e){
			log.debug(e);
		}
	}
}

